package CompareScheme;

import scheme.AA;

import java.security.NoSuchAlgorithmException;

/**
 * @Classname TimeCompare
 * @Description 对比实验
 * @Created by kevin
 */
public class TimeCompare {


    /**
     * 初始化时间
     */
    public static void SetUpTime() throws Exception {
        System.out.println("++++++++++++++++++++++++++++++++开始测试系统初始化时间********************************");
        for(int i = 5;i<=5*11;i+=5){
            System.out.println("*************************************属性数量是 "+(i)+" *************************************");

            System.out.println("系统初始化时间 "+paper2.AASetup(i)+" ms");
            System.out.println("系统初始化时间 "+paper3.Setup(i)+" ms");
//
        }


    }

    public static void AAKeyGenTime() throws Exception {
        System.out.println("++++++++++++++++++++++++++++++++开始测试用户密钥生成时间********************************");
        for(int i = 5;i<=5*11;i+=5){
            System.out.println("*************************************属性数量是 "+(i)+" *************************************");
            System.out.println("密钥生成时间 "+paper2.KeyGen(i)+" ms");
            System.out.println("密钥生成时间 "+paper3.KeyGen(i)+" ms");
            System.out.println("密钥生成时间 "+paper4.KeyGen(i)+" ms");

        }

    }

    /**
     * 用户加密时间
     */
    public static void UserEncryptTime() throws Exception {

        System.out.println("++++++++++++++++++++++++++++++++开始测试用户端解密时间********************************");
        for(int i = 5;i<=5*11;i+=5){
            System.out.println("*************************************属性数量是 "+(i)+" *************************************");
            System.out.println("用户端加密时间 "+paper2.Encrypt(i)+" ms");
            System.out.println("用户端加密时间 "+paper3.Encrypt(i)+" ms");
            System.out.println("用户端加密时间 "+paper4.Encrypt(i)+" ms");
        }
    }
    /**
     * 用户解密时间
     */
    public static void UserDecryptTime() throws Exception{
        System.out.println("++++++++++++++++++++++++++++++++开始测试用户端解密时间********************************");
        for(int i = 5;i<=5*11;i+=5){
            System.out.println("*************************************属性数量是 "+(i)+" *************************************");
//            System.out.println("用户端解密时间 "+paper1.Decrypt(i)+" ms");
            System.out.println("用户端解密时间 "+paper2.Decrypt(i)+" ms");
            System.out.println("用户端解密时间 "+paper3.Decrypt(i)+" ms");
            System.out.println("用户端解密时间 "+paper4.Decrypt(i)+" ms");
        }
    }


    public static void main(String [] args) throws Exception {
//        SetUpTime();
//        AAKeyGenTime();
//        UserEncryptTime();
        UserDecryptTime();
    }
}
